import { request } from '@/utils/request';
import type { IFooItem } from './foo.d';

export { IFooItem };

/** get 请求 */
export const getFooAPI = (name: string) => {
  return request<IFooItem>({
    url: `/foo`,
    method: 'GET',
    query: { name },
  });
};

/** get 请求 */
export const postFooAPI = (name: string) => {
  return request<IFooItem>({
    url: `/foo`,
    method: 'POST',
    query: { name }, // post 请求也支持 query
    data: { name },
  });
};
